import React, { Component } from 'react';
import { Tag } from 'antd'
import PropTypes from 'prop-types'
import './Card.scss'
class Card extends Component {
    constructor(props) {
        super(props);
        this.state = {};
    }
    render() {
        let { title, money, count, value } = this.props;
        return (
            <>
                <div className='card'>
                    <div className='card-title'>
                        <div className='card-name'>
                            {title}
                        </div>
                        <Tag color="#87d068">昨天</Tag>
                    </div>
                    <div className='card-content'>
                        <div className='card-content-p'>{value}</div>
                        <div className='card-content-h'>昨日环比:{count}</div>
                    </div>
                    <div className='card-bottom'>
                        <span>本月销售额:</span>
                        <span>{money}</span>
                    </div>
                </div>
            </>
        );
    }
}
Card.propTypes = {
    title: PropTypes.string.isRequired,
    value: PropTypes.number,
    count: PropTypes.number,
    money: PropTypes.oneOfType([
        PropTypes.string,
        PropTypes.number
    ])
}

Card.defaultProps = {
    value: 0,
    count: 0,
    money: 0
}

export default Card;